var zorbash = {
	home: function(e) {
		$(".page").animate({
				opacity: 0
			},
			1000,
			function() {
				$(".page h3").text();
				$(".page .content").html();
				$(".page").css("visibility","hidden");
				$(e.target).parent().attr("class","page")
				$(".page").css("opacity",1);
				$("div#dial-wrapper").css("display","block");
				zorbash.resetAnimations();
		});
	},
	moveToPage: function() {
		//console.log(this);
		$("div#dial-wrapper").css("display","none");
		//console.log($("."+this.id));
		$(".page h3").text($("."+this.id).children("h3").text());
		$(".page .content").html($("."+this.id).children(".content").html());
		$(".page").css("visibility","visible");
		$(".page").addClass(this.id);
		//fixPage();
		//$("."+g_Element.id).show("fold");
	
	},
	init: function() {
		$(".page span.home").click(zorbash.home);
		$("table span").click(zorbash.moveToPage);
	},
	tests: function() {
		if(
			Modernizr.csstransforms = true &&
			!jQuery.browser["firefox"] 
		) {
			return true;	
		}
		else {
			return false;	
		}
	},
	applyAnimations: function() {
		if(zorbash.tests()) {
			$("#dial-wrapper table").css(PrefixFree.prefix+"transition","all 600000s linear");
			$("#dial-wrapper table tr td").css(PrefixFree.prefix+"transition","all 600000s linear");
			$("#dial-wrapper .heartbeat").css(PrefixFree.prefix+"transition","all 1s ease-in-out");
			//$("div#dial-wrapper span")
			//$("#dial-wrapper .heartbeat").(PrefixFree.prefix+"transform","scale(2,2)");
			$("#dial-wrapper table").css(PrefixFree.prefix+"transform","rotate(3600000deg)");
			$("#dial-wrapper table tr td").css(PrefixFree.prefix+"transform","rotate(-3600000deg)");
		}
	},
	resetAnimations: function() {
		$("#dial-wrapper table").css(PrefixFree.prefix+"none");
		$("#dial-wrapper table tr td").css(PrefixFree.prefix+"none");
		$("#dial-wrapper .heartbeat").css(PrefixFree.prefix+"none");
		$("#dial-wrapper table").css(PrefixFree.prefix+"transition","all 600000s linear");
		$("#dial-wrapper table tr td").css(PrefixFree.prefix+"transition","all 600000s linear");
		$("#dial-wrapper .heartbeat").css(PrefixFree.prefix+"transition","all 1s ease-in-out");
			//$("#dial-wrapper .heartbeat").(PrefixFree.prefix+"transform","scale(2,2)");
		$("#dial-wrapper table").css(PrefixFree.prefix+"transform","rotate(0deg)");
		$("#dial-wrapper table tr td").css(PrefixFree.prefix+"transform","rotate(0deg)");
		$("#dial-wrapper table").css(PrefixFree.prefix+"transform","rotate(360000deg)");
		$("#dial-wrapper table tr td").css(PrefixFree.prefix+"transform","rotate(-360000deg)");
	}
};

$(function() {
	zorbash.applyAnimations();
	zorbash.init();
		
	
	
	
});
